/*
 * (C) 2014-2015 Alibaba Group Holding Limited
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 *
 *     __  ___   ______        ___       __          ___
 *    |  |/  /  /  __  \      /   \     |  |        /   \
 *    |  '  /  |  |  |  |    /  ^  \    |  |       /  ^  \
 *    |    <   |  |  |  |   /  /_\  \   |  |      /  /_\  \
 *    |  .  \  |  `--'  |  /  _____  \  |  `----./  _____  \
 *    |__|\__\  \______/  /__/     \__\ |_______/__/     \__\
 *
 *
 *
 */
//
// Created by KOALA TEAM on 12/19/14.
//

#import <UIKit/UIKit.h>

@interface UIImage (KLHelper)

+ (UIImage *)imageWithFileName:(NSString *)fileName;

- (UIImage *)scaleToSize:(CGSize)size;

- (UIImage *)aspectScaleToSize:(CGSize)size;

- (UIImage *)imageByCropping:(CGRect)rect;

- (UIImage *)imageByCroppingWithRatio:(float)value;

- (UIImage *)resizeImageWithCapInsets:(UIEdgeInsets)capInsets;

- (UIImage *)leftMirrorImageToRight;

- (UIImage *)topMirrorImageToBottom;

- (BOOL)writeImageToFileAtPath:(NSString *)aPath;

- (UIImage *)clipsImageToSize:(CGSize)desSZ;

- (UIImage *)resetSquareImage;

- (UIImage *)resetSquareImage:(CGSize)desSZ;

+ (UIImage *)createImageWithColor:(UIColor *)color;

- (UIImage*)cropImage:(UIImage*)image to:(CGRect)cropRect;

- (UIImage *)cropImage:(UIImage *)image to:(CGRect)cropRect andScaleTo:(CGSize)size;

- (UIImage *)ajustOrientation:(UIImage *)image;

+ (UIImage *)imageWithView:(UIView *)view;

+ (UIImage *) imageWithUrl:(NSString *)url;

- (NSData*)kl_data;

@end
